package com.zking.entity;

import java.lang.reflect.Field;

/**
 * 
 * @author Tony
 * 用户对应的实体类
 *
 */
public class User {
	private String eu_user_id;//用户名
	private String eu_user_name;//真实姓名
	private String eu_password;//密码
	private String eu_sex;//性别
	private String eu_birthday;//出生日期
	private String eu_identity_code;//身份证
	private String eu_email;//邮箱
	private String eu_mobile;//手机号
	private String eu_address;//地址
	private int eu_status;//类型 1普通用户2管理员

	private int is_deleted;

	public int getIs_deleted() {
		return is_deleted;
	}

	public void setIs_deleted(int is_deleted) {
		this.is_deleted = is_deleted;
	}

	public User() {
		super();
	}


	@Override
	public String toString() {
		return "User{" +
				"eu_user_id='" + eu_user_id + '\'' +
				", eu_user_name='" + eu_user_name + '\'' +
				", eu_password='" + eu_password + '\'' +
				", eu_sex='" + eu_sex + '\'' +
				", eu_birthday='" + eu_birthday + '\'' +
				", eu_identity_code='" + eu_identity_code + '\'' +
				", eu_email='" + eu_email + '\'' +
				", eu_mobile='" + eu_mobile + '\'' +
				", eu_address='" + eu_address + '\'' +
				", eu_status=" + eu_status +
				", is_deleted=" + is_deleted +
				'}';
	}

	public User(String euUserId, String euUserName, String euPassword,
				String euSex, String euBirthday, String euIdentityCode,
				String euEmail, String euMobile, String euAddress, int euStatus, int isDeleted) {
		super();
		eu_user_id = euUserId;
		eu_user_name = euUserName;
		eu_password = euPassword;
		eu_sex = euSex;
		eu_birthday = euBirthday;
		eu_identity_code = euIdentityCode;
		eu_email = euEmail;
		eu_mobile = euMobile;
		eu_address = euAddress;
		eu_status = euStatus;
		is_deleted = isDeleted;
	}

	public User(String euUserId, String euUserName, String euPassword,
				String euSex, String euBirthday, String euIdentityCode,
				String euEmail, String euMobile, String euAddress, int euStatus) {
		super();
		eu_user_id = euUserId;
		eu_user_name = euUserName;
		eu_password = euPassword;
		eu_sex = euSex;
		eu_birthday = euBirthday;
		eu_identity_code = euIdentityCode;
		eu_email = euEmail;
		eu_mobile = euMobile;
		eu_address = euAddress;
		eu_status = euStatus;
	}

	public String getEu_user_id() {
		return eu_user_id;
	}
	public void setEu_user_id(String euUserId) {
		eu_user_id = euUserId;
	}
	public String getEu_user_name() {
		return eu_user_name;
	}
	public void setEu_user_name(String euUserName) {
		eu_user_name = euUserName;
	}
	public String getEu_password() {
		return eu_password;
	}
	public void setEu_password(String euPassword) {
		eu_password = euPassword;
	}
	public String getEu_sex() {
		return eu_sex;
	}
	public void setEu_sex(String euSex) {
		eu_sex = euSex;
	}
	public String getEu_birthday() {
		return eu_birthday;
	}
	public void setEu_birthday(String euBirthday) {
		eu_birthday = euBirthday;
	}
	public String getEu_identity_code() {
		return eu_identity_code;
	}
	public void setEu_identity_code(String euIdentityCode) {
		eu_identity_code = euIdentityCode;
	}
	public String getEu_email() {
		return eu_email;
	}
	public void setEu_email(String euEmail) {
		eu_email = euEmail;
	}
	public String getEu_mobile() {
		return eu_mobile;
	}
	public void setEu_mobile(String euMobile) {
		eu_mobile = euMobile;
	}
	public String getEu_address() {
		return eu_address;
	}
	public void setEu_address(String euAddress) {
		eu_address = euAddress;
	}
	public int getEu_status() {
		return eu_status;
	}
	public void setEu_status(int euStatus) {
		eu_status = euStatus;
	}

	// Helper methods for birth date
	public int getBirthYear() {
		return Integer.parseInt(eu_birthday.split("-")[0]);
	}

	public int getBirthMonth() {
		return Integer.parseInt(eu_birthday.split("-")[1]);
	}

	public int getBirthDay() {
		return Integer.parseInt(eu_birthday.split("-")[2]);
	}

	public void setBirthDate(int year, int month, int day) {
		this.eu_birthday = year + "-" + String.format("%02d", month) + "-" + String.format("%02d", day);
	}

}
